package com.lib.framework.network.adapter.request

import retrofit2.Call
import retrofit2.CallAdapter
import java.lang.reflect.Type

/**
 * Copyright (C), 2019-2020
 * FileName: Request2CallAdapter
 * Author: Kevin
 * Date: 2020-01-06 16:57
 * Description: call 转成 request
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class Request2CallAdapter<R>(private val responseType: Type) : CallAdapter<R, ApiRequest<R>> {

    override fun responseType(): Type {
        return responseType
    }

    override fun adapt(call: Call<R>): ApiRequest<R> {
        return ApiRequest(call)
    }
}